//
//  ZTimeOutOrderDetailTreatedCell.m
//  DistributorAB
//
//  Created by LZY on 2019/10/16.
//  Copyright © 2019 主事丫环. All rights reserved.
//

#import "ZTimeOutOrderDetailTreatedCell.h"

@interface ZTimeOutOrderDetailTreatedCell ()
@property (nonatomic, strong) UILabel *lblName;//师傅姓名
@property (nonatomic, strong) UILabel *lblPhone;//联系电话
@property (nonatomic, strong) UILabel *lblResult;//处理结果

@end

@implementation ZTimeOutOrderDetailTreatedCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        [self setupViewAction];
    }
    return self;
}
#pragma mark - 界面布局
- (void)setupViewAction{
    self.contentView.backgroundColor = kColorWithHex(0xf2f2f2);
    
    UIView *viewBg = [UIView new];
    viewBg.backgroundColor = kColorWithHex(0xffffff);
    [self.contentView addSubview:viewBg];
    [viewBg mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(self.contentView.mas_leading).offset(10);
        make.trailing.equalTo(self.contentView.mas_trailing).offset(-10);
        make.top.equalTo(self.contentView.mas_top);
        make.bottom.equalTo(self.contentView.mas_bottom).offset(-13);
    }];
    
    UILabel *lblNotice = [UILabel new];
    lblNotice.text = @"给出回复:";
    lblNotice.font = [UIFont boldSystemFontOfSize:16];
    lblNotice.textColor = kColorWithHex(0x232620);
    [viewBg addSubview:lblNotice];
    [lblNotice mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.top.equalTo(viewBg.mas_top).offset(11);
        make.size.mas_equalTo(CGSizeMake(80, 22));
    }];
    
    UILabel *lblNoticeName = [UILabel new];
    lblNoticeName.textColor = kColorWithHex(0x666666);
    lblNoticeName.font = [UIFont systemFontOfSize:14];
    lblNoticeName.text = @"师傅姓名:";
    [viewBg addSubview:lblNoticeName];
    [lblNoticeName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.top.equalTo(lblNotice.mas_bottom).offset(16);
        make.size.mas_equalTo(CGSizeMake(70, 20));
    }];
    
    _lblName = [UILabel new];
    _lblName.font = [UIFont systemFontOfSize:14];
    _lblName.textColor = kColorWithHex(0x0d0e10);
    [viewBg addSubview:_lblName];
    [_lblName mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(lblNoticeName.mas_centerY);
        make.leading.equalTo(lblNoticeName.mas_trailing).offset(10);
        make.trailing.equalTo(viewBg.mas_trailing).offset(-10);
        make.height.mas_equalTo(20);
    }];
    
    UIView *viewLineOne = [UIView new];
    viewLineOne.backgroundColor = kColorWithHex(0xdbdbdb);
    [viewBg addSubview:viewLineOne];
    [viewLineOne mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lblNoticeName.mas_bottom).offset(11);
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.trailing.equalTo(viewBg.mas_trailing);
        make.height.mas_equalTo(1);
    }];
    
    UILabel *lblNoticePhone = [UILabel new];
    lblNoticePhone.textColor = kColorWithHex(0x666666);
    lblNoticePhone.font = [UIFont systemFontOfSize:14];
    lblNoticePhone.text = @"联系电话:";
    [viewBg addSubview:lblNoticePhone];
    [lblNoticePhone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.top.equalTo(viewLineOne.mas_bottom).offset(11);
        make.size.mas_equalTo(CGSizeMake(70, 20));
    }];
    
    _lblPhone = [UILabel new];
    _lblPhone.font = [UIFont systemFontOfSize:14];
    _lblPhone.textColor = kColorWithHex(0x0d0e10);
    [viewBg addSubview:_lblPhone];
    [_lblPhone mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(lblNoticePhone.mas_centerY);
        make.leading.equalTo(lblNoticePhone.mas_trailing).offset(10);
        make.trailing.equalTo(viewBg.mas_trailing).offset(-10);
        make.height.mas_equalTo(20);
    }];
    
    UIView *viewLineTwo = [UIView new];
    viewLineTwo.backgroundColor = kColorWithHex(0xdbdbdb);
    [viewBg addSubview:viewLineTwo];
    [viewLineTwo mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(lblNoticePhone.mas_bottom).offset(13);
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.trailing.equalTo(viewBg.mas_trailing);
        make.height.mas_equalTo(1);
    }];
    
    UIView *viewResult = [UIView new];
    viewResult.backgroundColor = kColorWithHex(0xf2f2f2);
    viewResult.layer.cornerRadius = 4;
    viewResult.layer.masksToBounds = YES;
    [viewBg addSubview:viewResult];
    [viewResult mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewLineTwo.mas_bottom).offset(10);
        make.leading.equalTo(viewBg.mas_leading).offset(10);
        make.trailing.equalTo(viewBg.mas_trailing).offset(-10);
        make.bottom.equalTo(viewBg.mas_bottom).offset(-27);
    }];
    
    _lblResult = [UILabel new];
    _lblResult.font = [UIFont systemFontOfSize:14];
    _lblResult.textColor = kColorWithHex(0x0d0e10);
    _lblResult.numberOfLines = 0;
    _lblResult.preferredMaxLayoutWidth = kScreen_Width - 60;
    [viewResult addSubview:_lblResult];
    [_lblResult mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(viewResult.mas_top).offset(10);
        make.leading.equalTo(viewResult.mas_leading).offset(10);
        make.trailing.equalTo(viewResult.mas_trailing).offset(-10);
        make.bottom.equalTo(viewResult.mas_bottom).offset(-10);
    }];
}
#pragma mark - 数据更新
- (void)setOrderModel:(ZTimeOutOrderModel *)orderModel{
    if (orderModel) {
        _orderModel = orderModel;
        _lblName.text = orderModel.repair_user_name;
        _lblPhone.text = orderModel.repair_user_phone;
        _lblResult.text = orderModel.delcontent;
    }
}
- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
